package entity.tx;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/**
 * @Written by T12 (IS3102 AY2011/12)
 */
@Entity
public class Venue implements Serializable {
    @Id
    private String name;
    private String address;
    private String layout;
    private Integer capacityCap;
    private Double latitude;
    private Double longitude;
    private Boolean active;

    public Venue(){
        
    }
    
    public void create(String name, String address, String layout, Integer capacityCap, Double latitude, Double longitude, Boolean active){
        this.setName(name);
        this.setAddress(address);
        this.setLayout(layout);
        this.setCapacityCap(capacityCap);
        this.setLatitude(latitude);
        this.setLongitude(longitude);
        this.setActive(active);
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCapacityCap() {
        return capacityCap;
    }

    public void setCapacityCap(Integer capacityCap) {
        this.capacityCap = capacityCap;
    }

    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    public String getLayout() {
        return layout;
    }

    public void setLayout(String layout) {
        this.layout = layout;
    }

    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (name != null ? name.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Venue)) {
            return false;
        }
        Venue other = (Venue) object;
        if ((this.name == null && other.name != null) || (this.name != null && !this.name.equals(other.name))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EventTicketing.Venue[ id=" + name + " ]";
    }
    
}
